
Page({
  data: {
    ty:"",
  },
  // 查看物流信息
  seelogistics:function(e){
    console.log(e)
    wx.navigateTo({
      url: '/pages/card_voucher/logistics/logistics?id=' + e.currentTarget.dataset.id
    })
  },
  // 未发货
  seelog:function(e){
    wx.showToast({
      title: '未发货，暂无物流信息',
      icon: 'none',      
      duration: 1500,      
    })
  },
  // 确认收货
  okGoods:function(e){
    let that = this
    console.log(e.currentTarget.dataset.id)
    let ind = e.currentTarget.dataset.ind
    // collect_gift_cards
    getApp().request({
      url: getApp().api.cardshop.collect_gift_cards,
      data: {
        id: e.currentTarget.dataset.id
      },
      success: function (t) {
        that.data.mycard.order_all[ind].state=2
        that.setData({
          mycard: that.data.mycard
        })
      }
    })
  },
  onLoad: function(options){
    let that = this
    let ty = options.ty
    getApp().request({
      url: getApp().api.cardshop.receive_cards_details,
      data: {
        id: options.id,
         
      },
      success: function (t) {
        console.log(t)
        that.setData({
          mycard:t.data,
          ty: ty
        })
      },
      complete: function () { }
    });
  },
  onReady: function(){
    
  },
  onShow: function(){
    
  },
  onHide: function(){

  },
  onUnload: function(){

  },
  onPullDownRefresh: function(){

  },
  onReachBottom: function(){

  },
  onShareAppMessage: function(){

  },
  onPageScroll: function(){

  },
  //item(index,pagePath,text)
  onTabItemTap:function(item){

  }
});